package com.qyt.hotel.controller;

import com.qyt.hotel.entity.Result;
import com.qyt.hotel.entity.RoomState;
import com.qyt.hotel.entity.StatusCode;
import com.qyt.hotel.service.RoomService;
import com.qyt.hotel.service.RoomStateService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@CrossOrigin(origins = "*")
@RestController
@RequestMapping("/roomState")
public class RoomStateController {
    @Resource
    private RoomStateService roomStateService;

    @GetMapping("/list")
    public Result getRoomStateList() {
        List<RoomState> stateList = roomStateService.getRoomStateList();
        return new Result("查询成功", true, StatusCode.OK, stateList);
    }

    // 获取添加时的房间状态信息
    @GetMapping("/listForAdd")
    public Result getRoomStateListForAdd() {
        List<RoomState> stateList = roomStateService.getRoomStateListForAdd();
        return new Result("查询成功", true, StatusCode.OK, stateList);
    }

    // 获取添加时的房间状态信息
    @GetMapping("/listForUpdate")
    public Result getRoomStateListForUpdate() {
        List<RoomState> stateList = roomStateService.getRoomStateListForUpdate();
        return new Result("查询成功", true, StatusCode.OK, stateList);
    }
}
